import iconList from "@/config/iconList";

export const datascopeOption = {
  lazy: true,
  tip: false,
  simplePage: true,
  searchShow: true,
  searchMenuSpan: 6,
  align: 'center',
  tree: true,
  border: true,
  viewBtn: false,
  editBtn: false,
  addBtn: false,
  delBtn: false,
  menuWidth: 70,
  dialogClickModal: false,
  columnBtn: false,
  height: document.documentElement.clientHeight - 254,//有search
  column: [
    {
      label: "菜单名称",
      prop: "name",
      minWidth: 100,
      search: true,
      rules: [
        {
          required: true,
          message: "请输入菜单名称",
          trigger: "blur"
        }]
    },
    {
      label: "路由地址",
      prop: "path",
      minWidth: 100,
      rules: [
        {
          required: true,
          message: "请输入路由地址",
          trigger: "blur"
        }
      ]
    },
    {
      label: "上级菜单",
      prop: "parentId",
      minWidth: 100,
      type: "tree",
      dicUrl: "/api/uic-system/menu/tree",
      hide: true,
      props: {
        label: "title"
      },
      rules: [
        {
          required: false,
          message: "请选择上级菜单",
          trigger: "click"
        }
      ]
    },
    {
      label: "菜单图标",
      prop: "source",
      type: "icon-select",
      slot: true,
      width: 100,
      iconList: iconList,
      rules: [
        {
          required: true,
          message: "请输入菜单图标",
          trigger: "click"
        }
      ]
    },
    {
      label: "菜单编号",
      prop: "code",
      search: true,
      minWidth: 100,
      rules: [
        {
          required: true,
          message: "请输入菜单编号",
          trigger: "blur"
        }
      ]
    },
    {
      label: "菜单类型",
      prop: "category",
      minWidth: 100,
      type: "radio",
      dicData: [
        {
          label: "菜单",
          value: 1
        },
        {
          label: "按钮",
          value: 2
        },
        {
          label: "小程序菜单",
          value: 3
        },
        {
          label: "小程序按钮",
          value: 4
        }
      ],
      hide: true,
      rules: [
        {
          required: true,
          message: "请选择菜单类型",
          trigger: "blur"
        }
      ]
    },
    {
      label: "菜单别名",
      prop: "alias",
      minWidth: 100,
      rules: [
        {
          required: true,
          message: "请输入菜单别名",
          trigger: "blur"
        }
      ]
    },
    {
      label: "按钮功能",
      minWidth: 100,
      prop: "action",
      type: "radio",
      dicData: [
        {
          label: "工具栏",
          value: 0
        },
        {
          label: "操作栏",
          value: 1
        },
        {
          label: "工具操作栏",
          value: 2
        }
      ],
      hide: true,
      rules: [
        {
          required: true,
          message: "请选择按钮功能",
          trigger: "blur"
        }
      ]
    },
    {
      label: "菜单排序",
      prop: "sort",
      type: "number",
      width: 100,
      rules: [
        {
          required: true,
          message: "请输入菜单排序",
          trigger: "blur"
        }
      ]
    },
    {
      label: "新窗口",
      prop: "isOpen",
      minWidth: 100,
      type: "radio",
      dicData: [
        {
          label: "否",
          value: 0
        },
        {
          label: "是",
          value: 1
        },
      ],
      hide: true
    },
    {
      label: "菜单备注",
      prop: "remark",
      minWidth: 100,
      type: "textarea",
      span: 24,
      minRows: 6,
      hide: true
    }
  ]
};
export const optionScope = {
  align: 'center',
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  selection: true,
  dialogCustomClass: 'fixedtable',
  dialogWidth: 500,
  menuWidth: 150,
  dialogClickModal: false,
  addBtn: false,
  dialogMenuPosition: 'center',
  columnBtn: false,
  height: document.documentElement.clientHeight - 304,//有search
  column: [
    {
      label: "权限名称",
      prop: "scopeName",
      minWidth: 100,
      search: true,
      value: "",
      span: 24,
      rules: [{
        required: true,
        message: "请输入数据权限名称",
        trigger: "blur"
      }]
    },
    {
      label: "权限编号",
      prop: "resourceCode",
      search: true,
      width: 100,
      span: 24,
      rules: [{
        required: true,
        message: "请输入数据权限编号",
        trigger: "blur"
      }]
    },
    {
      label: "权限字段",
      prop: "scopeColumn",
      width: 130,
      span: 24,
      rules: [{
        required: true,
        message: "请输入数据权限编号",
        trigger: "blur"
      }]
    },
    {
      label: "规则类型",
      type: "select",
      dicUrl: "/api/uic-system/dict/dictionary?code=data_scope_type",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      span: 24,
      dataType: "number",
      slot: true,
      width: 140,
      prop: "scopeType",
      rules: [{
        required: true,
        message: "请输入通知类型",
        trigger: "blur"
      }]
    },
    {
      label: "可见字段",
      prop: "scopeField",
      span: 24,
      hide: true,
      value: "*",
      rules: [{
        required: true,
        message: "请输入数据权限可见的字段",
        trigger: "blur"
      }],
    },
    {
      label: "权限类名",
      prop: "scopeClass",
      span: 24,
      hide: true,
      rules: [{
        required: true,
        message: "请输入MybatisMapper对应方法的完整类名路径",
        trigger: "blur"
      }],
    },
    {
      label: "规则值",
      prop: "scopeValue",
      span: 24,
      minRows: 5,
      type: "textarea",
      display: true,
      hide: true,
    },
    {
      label: "备注",
      prop: "remark",
      span: 24,
      hide: true
    },
  ]
}
